﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <link href="~/kj/layui/css/layui.css" rel="stylesheet" />
    <style>
        a {
            cursor: pointer;
        }
    </style>
</head>
<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">在线投票系统</div>
            <!-- 头部区域（可配合layui已有的水平导航） -->
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        @ViewBag.User
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a id="123" style="display: block;">修改密码</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="/Home/Logout">退出</a></li>
            </ul>
        </div>

        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item layui-nav-itemed">
                        <a class="" href="javascript:;">比赛管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="/Active/ActiveManager" target="FramContent">比赛概览</a></dd>
                            <dd><a href="/Active/CreateActive" target="FramContent">添加比赛</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">用户管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="/User/UserManager" target="FramContent">用户管理</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>

        <div class="layui-body" style="width: 100%;border:none;">
            <!-- 内容主体区域 -->
            <iframe id="FramContent" name="FramContent" frameborder="0" class="layui-col-md12" height="100%" ></iframe>
        </div>

        <div class="layui-footer">
            <!-- 底部固定区域 -->
            © 在线投票系统
        </div>
    </div>
    <script src="~/kj/layui/layui.js"></script>
    <script>
//JavaScript代码区域
        layui.use(['element','jquery','layer'], function () {
            var element = layui.element;
            var $ = layui.jquery;
            var layer = layui.layer;

            $("#123").click(function () {
                layer.open({
                    title: '修改密码',
                    type: 1,
                    area: ['400px', '380px'],
                    resize: false,
                    anim: 1,
                    skin: 'layui-layer-molv', //样式类名
                    btnAlign: 'c',
                    btn: ['添加', '取消'],
                    content: '<div class="layui-form-item" style="margin-top:100px;"><label class="layui-form-label">密码</label><div class="layui-input-inline layui-col-md4"><input type="password" class="layui-input" name="passwrod"/></div></div><div class="layui-form-item  "><label class="layui-form-label">确认密码</label><div class="layui-input-inline layui-col-md4"><input type="password" class="layui-input" name="passwrod2"/></div></div>',
                    btn1: function (index, layero) {
                        passwrod = $('[Name=passwrod]').val();
                        passwrod2 = $('[Name=passwrod2]').val();
                        if (passwrod == passwrod2) {
                            $.post("/Home/UpdatePwd", { pwd: passwrod }, function (data) {
                                layer.msg("修改成功！");
                                layer.close(index);
                            });
                        }
                        else { layer.msg("两次密码不相同，请重新输入"); }
                    }
                });
            });
        });
    </script>
</body>
</html>
